﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VOL;
using BLL;
using System.Data;
namespace WebShoes
{
    public partial class ChiTietForm : System.Web.UI.Page
    {
        HangHoaBL _HangHoaBL = new HangHoaBL();
        protected void Page_Load(object sender, EventArgs e)
        {
            int _MaHang = 0;
            if (Request.QueryString["MaHangHoa"] != null)
            {
                int.TryParse(Request.QueryString["MaHangHoa"], out _MaHang);
            }

            if (_MaHang > 0)
            {
                DataTable dt = _HangHoaBL.chiTiet(_MaHang);
                lblTenHang.Text = dt.Rows[0]["TenHangHoa"].ToString();
                lblMota.Text = dt.Rows[0]["ChiTiet"].ToString();
                lblDonGia.Text = dt.Rows[0]["DonGia"].ToString();
                Image1.ImageUrl = dt.Rows[0]["HinhAnh"].ToString();
                hlkNhaCungCap.NavigateUrl = "~/SanPhamForm.aspx?MaNhaSanXuat=" + dt.Rows[0]["MaNhaSanXuat"].ToString();
                hlkNhaCungCap.Text = dt.Rows[0]["TenNhaSanXuat"].ToString();
                hlkLoaiHang.NavigateUrl = "~/SanPhamForm.aspx?MaLoaiHangHoa=" + dt.Rows[0]["MaLoaiHangHoa"].ToString();
                hlkLoaiHang.Text = dt.Rows[0]["TenLoaiHangHoa"].ToString();
                hlkCart.NavigateUrl = "~/GioHangForm.aspx?MaHangHoa=" + dt.Rows[0]["MaHangHoa"].ToString();
            }
        }
    }
}